	
/****** Object:  Stored Procedure DeliveredOrdersInsert    Script Date: Thursday, August 10, 2006 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[spDeliveredOrdersInsert]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [spDeliveredOrdersInsert]
GO

	
	

/******************************************************************************
**		File: 
**		Name: spDeliveredOrdersInsert
**		Desc: 
**
**		Return values:
** 
**		Called by:   
**              
**		Parameters:
**		Input							Output
**     ----------							-----------
**
**		Auth: CodeSmith
**		Date: 8/10/2006 3:27:02 PM
*******************************************************************************
**		Change History
*******************************************************************************
**		Date:		Author:				Description:
**		--------		--------				-------------------------------------------
**    
*******************************************************************************/
CREATE PROCEDURE spDeliveredOrdersInsert
	@OfficeID int,
	@SupplierCode varchar(3),
	@OrderNo varchar(3),
	@YY char(2),
	@OrderDate datetime,
	@QtyIssued int,
	@DateIssued datetime,
	@ProductCode varchar(5),
	@BulkOrderID int,
	@CustomerName varchar(50),
	@POID int,
	@DeliveredOrderID int output
AS

INSERT INTO [DeliveredOrders] 
(
	[OfficeID],
	[SupplierCode],
	[OrderNo],
	[YY],
	[OrderDate],
	[QtyIssued],
	[DateIssued],
	[ProductCode],
	[BulkOrderID],
	[CustomerName],
	[POID]
) 
VALUES 
(
	@OfficeID,
	@SupplierCode,
	@OrderNo,
	@YY,
	@OrderDate,
	@QtyIssued,
	@DateIssued,
	@ProductCode,
	@BulkOrderID,
	@CustomerName,
	@POID
)

SELECT @DeliveredOrderID = @@IDENTITY

GO
	
